package com.itheima.erfenchazhao;

import java.sql.SQLOutput;
import java.util.Scanner;
import java.util.SortedMap;

public class Test {
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        System.out.println("请输入要查找的数：");
        int number = sc.nextInt();
       int result=-1;
        int[] arr = {10, 20, 30, 40, 50, 60, 70, 80, 90, 100};
        int left = 0;
        int right = arr.length - 1;
        while (left <= right) {
            int mid = (left + right) / 2;
            if(arr[mid] == number){
             result = mid;
             break;
             }else if(arr[mid] > number){
                 right = mid - 1;
             }else{
                 left = mid + 1;
             }





        }
        System.out.println(result);
    }

}
